﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<OAonline.Models.FormModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">

    <script type="text/javascript">
        function onfilter(theform) {
            if (theform.fileData.value == "") {
                alert("请点击浏览按钮，选择您要上传的压缩包类型文件!")
                return (false);
            }
            else {
                str = theform.fileData.value;
                strs = str.toLowerCase();
                lens = strs.length;
                extname = strs.substring(lens - 4, lens);
                if (extname != ".rar") {
                    alert("请选择压缩包类型文件!");
                    return (false);
                }
            }
            return (true);
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h5>
        注意：上传同一文件名视为更新原先同名文件版本!</h5>
    <div id="form_uploadify">
        <form action="<%=Url.Action("Import") %>" enctype="multipart/form-data" method="post"
        onsubmit="return onfilter(this)">
        <input name="fileData" type="file" />
        <br />
        <input type="submit" value="上传" />
        </form>
    </div>
    <div id="formlist">
        <span id="formlist_headertitle">表单列表</span>
        <table id="formlist_content" cellspacing="0" cellpadding="0" border="0">
            <tr>
                <th>
                    表单名称
                </th>
                <th>
                    创建人
                </th>
                <th>
                    创建时间
                </th>
                <th>
                    操作
                </th>
            </tr>
            <%
                int count = Model.dt_forms.Rows.Count;
                for (int i = 0; i < count; i++)
                {
            %>
            <tr>
                <td>
                    <%=Model.dt_forms.Rows[i]["表单名称"]%>
                </td>
                <td>
                    <%=Model.dt_forms.Rows[i]["创建人"]%>
                </td>
                <td>
                    <%=Model.dt_forms.Rows[i]["创建时间"]%>
                </td>
                <td>
                    <%=Html.ActionLink("查看", "FormShow", new { form_id = Model.dt_forms.Rows[i]["编码"] })%>
                </td>
            </tr>
            <%
                } %>
        </table>
    </div>
</asp:Content>
